# run.py
from werkzeug.middleware.dispatcher import DispatcherMiddleware
from werkzeug.serving import run_simple

from hp_fixar_v01.app import app as main_app
from hp_sta_v01.app import app as stats_app

# DispatcherMiddleware：主路径挂 main_app，/stats 单独挂 stats_app
application = DispatcherMiddleware(main_app, {
    '/stats': stats_app
})

if __name__ == '__main__':
    run_simple('0.0.0.0', 7777, application) #, use_debugger=True, use_reloader=True
